import mountElement from "./mountElement"
import { unmount } from '../browserRendererOptions'

export default function patch(n1, n2, container, anchor) {
  if(n1.type !== n2.type) {
    unmount(n1)
    n1 = null
  }
  const {type} = n2
  if(typeof type === 'string') {
    if(!n1) {
      mountElement(n2, container, anchor)
    } else {
      patchElement(n1, n2)
    }
  } else if(typeof type === 'object') {
    if(!n1) {
      //mountComponent()
    } else {
      //patchComponent()
    }
  }
}
